﻿using System;
using System.Collections;
using System.Text;

// 版权所有：2014  All Rights Reserved.
// 文 件 名：Glo.cs
// 功能描述：全局变量
// 创建标识：m.sh.lin0328@163.com 2014/12/6 14:29:56
// 修改描述：
//----------------------------------------------------------------*/
namespace MslDiary.Framework
{
    public class Gloable
    {
        public static string ENCRYPY_KEY { set; get; }
        static Gloable()
        {
            SpiderChar = '⊙';
            MinimizeToTray = false;
            HomePageUrl = "http://home.cnblogs.com/u/shanlin/";
            if (String.IsNullOrEmpty(ENCRYPY_KEY))
                ENCRYPY_KEY = "msl.diary_user";
        }

        #region 系统属性

        public const string ApplicationName = "MslDiary";//应用程序英文名
        /// <summary>个人主页</summary>
        public static string HomePageUrl { set; get; }
        /// <summary>字符串特殊分割符</summary>
        public static char SpiderChar { set; get; }
        /// <summary>是否最小化到托盘</summary>
        public static bool MinimizeToTray { set; get; }
        /// <summary>是否记录运行日志</summary>
        public static bool SaveLog { set; get; }
        /// <summary>是否登录成功</summary>
        public static bool LoginSuccessed { set; get; }
        /// <summary>程序启动目录</summary>
        public static string StartPath { get; set; }
        /// <summary>配置文件路径</summary>
        public static string Config { get; set; }
        /// <summary>主窗口是否显示</summary>
        public static bool IsMainWinShow { set; get; }
        /// <summary>主窗口宽度</summary>
        public static double MainWindowWidth { set; get; }
        /// <summary>主窗口宽度是否变化</summary>
        public static bool IsWidthChanged { set; get; }
        /// <summary>是否自动检查更新</summary>
        public static bool AutoCheckUpdate { get; set; }
        /// <summary>是否开机自动启动</summary>
        public static bool IsAutoRun { get; set; }
        /// <summary>缓存目录</summary>
        public static string CachePath { get; set; }
        #endregion

        #region 自定义属性
        public static int PageIndex { get; set; }
        public static bool MinimizeToAutoLock { get; set; }
        /// <summary>主窗体背景</summary>
        public static string AppBackgroundImage { get; set; }
        /// <summary>主题是否产生变化</summary>
        public static bool IsSkinChanged { get; set; }

        /// <summary>编辑器背景</summary>
        public static string EditorBackgroundImage { get; set; }
        /// <summary>编辑器背景是否产生变化</summary>
        public static bool IsEditorSkinChanged { get; set; }
        #endregion

        #region 密钥

        ///<summary>日记加密密钥</summary>
        public static string DiaryEncryptKey
        {
            get
            {
                return MSL.Tool.Security.MD5Encrypt.MD5("msl.diary_" + ENCRYPY_KEY);
            }
        }
        /// <summary>数据库加密密钥</summary>
        public static string DbEncryptKey
        {
            get
            {
                return MSL.Tool.Security.MD5Encrypt.MD5("msl.db_" + ENCRYPY_KEY);
            }
        }
        /// <summary>普通加密密钥</summary>
        public static string NormalEncryptKey
        {
            get
            {
                return MSL.Tool.Security.MD5Encrypt.MD5("msl.normal_" + ENCRYPY_KEY);
            }
        }
        #endregion

        #region 用户信息
        /// <summary>日记锁定密码</summary>
        public static string DiaryLockPwd { get; set; }
        /// <summary>是否立即锁定日记</summary>
        public static bool IsImmediatelyLock { get; set; }
        /// <summary>记事锁定密码</summary>
        public static string NoteLockPwd { get; set; }
        /// <summary>日记是否锁定</summary>
        public static bool DiaryIsLock { get; set; }
        /// <summary>锁定是否记事</summary>
        public static bool NoteIsLock { get; set; }
        /// <summary>当前登录账号</summary>
        public static string CurrentLoginedAccount { get; set; }
        /// <summary>登录密码</summary>
        public static string DiaryLoginPwd { get; set; }
        /// <summary>显示名称</summary>
        public static string Name { get; set; }
        /// <summary>登录信息</summary>
        //public static string LoginingInfo { get; set; }
        /// <summary>昵称</summary>
        public static string NickName { get; set; }
        /// <summary>无操作多长时间锁定 单位：秒</summary>
        public static int LeaveTimeToLock { get; set; }
        /// <summary>用户账号密码</summary>
        public static Hashtable UserPwdTable { get; set; }
        /// <summary>富文本表情图片文本夹</summary>
        public static string FaceImagePath { get; set; }
        #endregion
    }
}
